package com.ang;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;

import java.util.List;

/**
 * @author ssang
 * @date 2022-06-21 10:21
 */
public class Test02 {
    public static void main(String[] args) {
        String str =
                "[" +
                        " {\"source\": \"卡介苗\",\"target\": \"芜湖市疾控\", \"value\": 40}," +
                        " {\"source\": \"乙肝疫苗\",\"target\": \"芜湖市疾控\", \"value\": 40}," +
                        " {\"source\": \"脊灰疫苗\",\"target\": \"芜湖市疾控\", \"value\": 40}," +
                        " {\"source\": \"百白破\",\"target\": \"芜湖市疾控\", \"value\": 40}," +
                        " {\"source\": \"流感疫苗\",\"target\": \"非市集采疫苗\", \"value\": 35}," +
                        " {\"source\": \"肺炎疫苗\",\"target\": \"非市集采疫苗\", \"value\": 35}," +
                        // 芜湖市疾控 —— 鸠江区疾控
                        " {\"source\": \"芜湖市疾控\",\"target\": \"鸠江区疾控\", \"value\": 13, lineStyle: \"{color: '#D35A7F'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"鸠江区疾控\", \"value\": 10, lineStyle: \"{color: '#2F8AE7'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"鸠江区疾控\", \"value\": 10, lineStyle: \"{color: '#887BCD'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"鸠江区疾控\", \"value\": 10, lineStyle: \"{color: '#E65C2E'}\"}," +
                        // 芜湖市疾控 —— 弋江区疾控
                        " {\"source\": \"芜湖市疾控\",\"target\": \"弋江区疾控\", \"value\": 7, lineStyle: \"{color: '#D35A7F'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"弋江区疾控\", \"value\": 7, lineStyle: \"{color: '#2F8AE7'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"弋江区疾控\", \"value\": 7, lineStyle: \"{color: '#887BCD'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"弋江区疾控\", \"value\": 6, lineStyle: \"{color: '#E65C2E'}\"}," +
                        // 芜湖市疾控 —— 镜湖区疾控
                        " {\"source\": \"芜湖市疾控\",\"target\": \"镜湖区疾控\", \"value\": 7, lineStyle: \"{color: '#D35A7F'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"镜湖区疾控\", \"value\": 7, lineStyle: \"{color: '#2F8AE7'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"镜湖区疾控\", \"value\": 7, lineStyle: \"{color: '#887BCD'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"镜湖区疾控\", \"value\": 6, lineStyle: \"{color: '#E65C2E'}\"}," +
                        // 芜湖市疾控 —— 繁昌区疾控
                        " {\"source\": \"芜湖市疾控\",\"target\": \"繁昌区疾控\", \"value\": 7, lineStyle: \"{color: '#D35A7F'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"繁昌区疾控\", \"value\": 7, lineStyle: \"{color: '#2F8AE7'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"繁昌区疾控\", \"value\": 7, lineStyle: \"{color: '#887BCD'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"繁昌区疾控\", \"value\": 6, lineStyle: \"{color: '#E65C2E'}\"}," +
                        // 芜湖市疾控 —— 湾沚区疾控
                        " {\"source\": \"芜湖市疾控\",\"target\": \"湾沚区疾控\", \"value\": 10, lineStyle: \"{color: '#D35A7F'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"湾沚区疾控\", \"value\": 10, lineStyle: \"{color: '#2F8AE7'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"湾沚区疾控\", \"value\": 10, lineStyle: \"{color: '#887BCD'}\"}," +
                        " {\"source\": \"芜湖市疾控\",\"target\": \"湾沚区疾控\", \"value\": 10, lineStyle: \"{color: '#E65C2E'}\"}," +
                        // 非市集采疫苗 —— 鸠江区疾控
                        " {\"source\": \"非市集采疫苗\",\"target\": \"鸠江区疾控\", \"value\": 8, lineStyle: \"{color: '#7CF6FC'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"鸠江区疾控\", \"value\": 10, lineStyle: \"{color: '#7CAC60'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"弋江区疾控\", \"value\": 4, lineStyle: \"{color: '#7CF6FC'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"弋江区疾控\", \"value\": 6, lineStyle: \"{color: '#7CAC60'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"镜湖区疾控\", \"value\": 7, lineStyle: \"{color: '#7CF6FC'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"镜湖区疾控\", \"value\": 8, lineStyle: \"{color: '#7CAC60'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"繁昌区疾控\", \"value\": 7, lineStyle: \"{color: '#7CF6FC'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"繁昌区疾控\", \"value\": 8, lineStyle: \"{color: '#7CAC60'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"湾沚区疾控\", \"value\": 4, lineStyle: \"{color: '#7CF6FC'}\"}," +
                        " {\"source\": \"非市集采疫苗\",\"target\": \"湾沚区疾控\", \"value\": 6, lineStyle: \"{color: '#7CAC60'}\"}," +
                        // 鸠江区疾控 —— 裕溪口街道社区
                        " {\"source\": \"鸠江区疾控\",\"target\": \"裕溪口街道社区\", \"value\": 8, lineStyle: \"{color: '#FFA201'}\"}," +
                        " {\"source\": \"鸠江区疾控\",\"target\": \"裕溪口街道社区\", \"value\": 6, lineStyle: \"{color: '#6BE3FF'}\"}," +
                        " {\"source\": \"鸠江区疾控\",\"target\": \"裕溪口街道社区\", \"value\": 5, lineStyle: \"{color: '#887BCD'}\"}," +
                        // 鸠江区疾控 —— 官陡社区医院
                        " {\"source\": \"鸠江区疾控\",\"target\": \"官陡社区医院\", \"value\": 9, lineStyle: \"{color: '#FFA201'}\"}," +
                        " {\"source\": \"鸠江区疾控\",\"target\": \"官陡社区医院\", \"value\": 7, lineStyle: \"{color: '#6BE3FF'}\"}," +
                        " {\"source\": \"鸠江区疾控\",\"target\": \"官陡社区医院\", \"value\": 6, lineStyle: \"{color: '#887BCD'}\"}," +
                        // 弋江区疾控 —— 弋江桥街道社区
                        " {\"source\": \"弋江区疾控\",\"target\": \"弋江桥街道社区\", \"value\": 9, lineStyle: \"{color: '#FFA201'}\"}," +
                        " {\"source\": \"弋江区疾控\",\"target\": \"弋江桥街道社区\", \"value\": 7, lineStyle: \"{color: '#3598F5'}\"}," +
                        " {\"source\": \"弋江区疾控\",\"target\": \"弋江桥街道社区\", \"value\": 6, lineStyle: \"{color: '#887BCD'}\"}," +
                        // 镜湖区疾控 —— 方村卫生院
                        "{\"source\": \"镜湖区疾控\",\"target\": \"方村卫生院\", \"value\": 9, lineStyle: \"{color: '#E65D2F'}\"}," +
                        "{\"source\": \"镜湖区疾控\",\"target\": \"方村卫生院\", \"value\": 7, lineStyle: \"{color: '#6BE3FF'}\"}," +
                        "{\"source\": \"镜湖区疾控\",\"target\": \"方村卫生院\", \"value\": 6, lineStyle: \"{color: '#887BCD'}\"}," +
                        // 繁昌区疾控 —— 繁阳社区
                        "{\"source\": \"繁昌区疾控\",\"target\": \"繁阳社区\", \"value\": 9, lineStyle: \"{color: '#E65D2F'}\"}," +
                        " {\"source\": \"繁昌区疾控\",\"target\": \"繁阳社区\", \"value\": 7, lineStyle: \"{color: '#FFA201'}\"}," +
                        " {\"source\": \"繁昌区疾控\",\"target\": \"繁阳社区\", \"value\": 6, lineStyle: \"{color: '#887BCD'}\"}," +
                        // 湾沚区疾控 —— 湾沚社区医院
                        " {\"source\": \"湾沚区疾控\",\"target\": \"湾沚社区医院\", \"value\": 9, lineStyle: \"{color: '#E65D2F'}\"}," +
                        " {\"source\": \"湾沚区疾控\",\"target\": \"湾沚社区医院\", \"value\": 7, lineStyle: \"{color: '#FFA201'}\"}," +
                        " {\"source\": \"湾沚区疾控\",\"target\": \"湾沚社区医院\", \"value\": 6, lineStyle: \"{color: '#6BE3FF'}\"}," +
                        " {\"source\": \"湾沚区疾控\",\"target\": \"湾沚社区医院\", \"value\": 7, lineStyle: \"{color: '#887BCD'}\"}," +
                        "]";

        System.out.println(str);

        List<DataItem> list = JSON.parseArray(str, DataItem.class);
        System.out.println(list.size());
    }

    @Data
    public static class DataItem{
        private String name;

        private Integer value;

        private Integer depth;

        private String itemStyle;
    }
}
